#include "qlab1picture.h"
#include <QPainter>
#include "ean13.h"

QLab1Picture::QLab1Picture(QGraphicsItem *parent, QGraphicsScene *scene)
	: QGraphicsTextItem(parent, scene)
{
		setFlag(QGraphicsItem::ItemIsSelectable);
		setFlag(QGraphicsItem::ItemIsMovable);
}
void QLab1Picture::SetId(int id)
{
m_id=id;
}


void QLab1Picture::Set_m_Text(QString a_text)
{
m_text=a_text;
}


int QLab1Picture::GetId()
{
	return m_id;
}

void QLab1Picture::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
//  	if((m_id==0)&&(m_text!=""))
//  	{
//  //	QGraphicsTextItem::paint(painter, option, widget);
//  	EAN13 code(m_text);
//  //	painter->fillRect(boundingRect(),Qt::white);
//  	code.draw(QRectF(0,0,boundingRect().height()*37.29/10.93,boundingRect().height()),*painter);
//  	}
//  	else
//  	{
//  		QGraphicsTextItem::paint(painter, option, widget);
//  	}
//  	// 	painter->drawRoundedRect(0, 0, boundingRect().width(), 
//  // 	boundingRect().height(), 5, 5);

	QGraphicsTextItem::paint(painter, option, widget);

}

